programming4us
           
 
 
Sharepoint

SharePoint 2010 : Site Administration - Provisioning a site via Windows PowerShell

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019
7/17/2013 3:55:17 AM

PowerShell is a scripting technology that can be used to automate many of the tasks an administrator must perform. It is performed through a console, on the server running PowerShell.

Provisioning sites at enterprise companies is one of those tasks that can be automated. While this can be performed through the Central Administration interface, it is more efficient to perform this task through PowerShell.

This recipe will show how to provision a site collection.

Getting ready

User must have access to one of the servers running PowerShell 2.0 and must be a member of the WSS_ADMIN_WPG role on the local computer. User must also be a member of the db_owner database role&; and the SharePoint_Shell_Access role in the following databases:

  • Source content database

  • Administration content database

  • Destination Content Database

  • Configuration Database

How to do it...

  1. Click on the Start button on the web front-end.

  2. Under All Programs, navigate to the Microsoft SharePoint 2010 Products folder.

  3. Right-click SharePoint 2010 Management Shell and select the Run as Administrator option. The PowerShell console will appear.

  4. Type in the following commands into the console window, pressing the Enter key after each command:

    $url = "http://2008server/ts"
    $SiteTitle = "Team Site"
    $teamsite = Get-SPWebTemplate "STS#0"
    New-SPSite -URL $url -OwnerAlias domain/username -Template $teamsite -name $SiteTitle
    
    
    					  
  5. You will see the screen confirming that the site has now been created (refer to the next screenshot).&;&;

How it works...

This is a very simple PowerShell script that creates a site collection. These scripts can be combined into a .ps1 file. By doing this, the administrator can automate the creation of sites and utilize parameters or reference an XML file to create multiple sites.

The first line assigns the new site collection URL, http://2008server/ts, to the $url variable. Team Site is the name of the site collection.

Get-SPWebTemplate&; gets all the available SharePoint site templates. STS#0 is the template for the Team Site site collection and is assigned to the $teamsite variable&;.

New-SPSite&; utilizes all the variables and, using a domain account, creates the site collection ts. The account will be made the Site Collection Administrator for the newly created site collection.

There's more...

This is only one example of the New-SPSite command&;. However, if you type Get-help New-SPSite examples in the PowerShell console, you are provided with three additional examples.

Typing in Get-help New-SPSite full gives you a brief description of the parameters and notifies you which ones are required.&;&;
Other -----------------
- SharePoint 2010 : Site Administration - Migrating a site collection
- SharePoint 2010 : Word Automation Services - Demonstration Scenario (part 4) - Combine Documents Using OpenXML, Converting an OpenXML Document to an Alternative Format
- SharePoint 2010 : Word Automation Services - Demonstration Scenario (part 3) - Combine Documents Using OpenXML, Converting an OpenXML Document to an Alternative Format
- SharePoint 2010 : Word Automation Services - Demonstration Scenario (part 2) - Customizing the DocumentSetProperties Web Part
- SharePoint 2010 : Word Automation Services - Demonstration Scenario (part 1) - Creating a Custom Content Type
- SharePoint 2010 : Word Automation Services - Creating Conversion Jobs, Checking Status of Conversion Jobs
- SharePoint 2010 : The Client Object Model (part 4) - WebPart Communication Without Postbacks
- SharePoint 2010 : The Client Object Model (part 3) - Writing the JavaScript WebPart
- SharePoint 2010 : The Client Object Model (part 2) - Writing the Silverlight WebPart
- SharePoint 2010 : The Client Object Model (part 1) - Infrastructural Objects, Object Identity
- SharePoint 2010 : Making Enterprise Content Management Work - Records Management (part 2) - Configuring Enterprise Document and Records Management
- SharePoint 2010 : Making Enterprise Content Management Work - Records Management (part 1) - Record Declaration, Information Management Policies
- SharePoint 2010 : Making Enterprise Content Management Work - Document Management (part 3) - Document IDs, Managed Metadata
- SharePoint 2010 : Making Enterprise Content Management Work - Document Management (part 2) - Document Sets
- SharePoint 2010 : Making Enterprise Content Management Work - Document Management (part 1) - Item-level Security, Versioning Settings
- SharePoint 2010 : Setting Lockdown Mode for publishing sites, Configuring Site Collection audit settings, Accessing security policy reports
- SharePoint 2010 : Checking effective permission user interface
- SharePoint 2010 : Adding a user via PowerShell, Delegating PowerShell permissions
- SharePoint Server 2010 Business Intelligence Platform (part 6) - Reporting Services
- SharePoint Server 2010 Business Intelligence Platform (part 5) - PowerPivot
 
 
 
Top 10
 
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 2) - Wireframes,Legends
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Finding containers and lists in Visio (part 1) - Swimlanes
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Formatting and sizing lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Adding shapes to lists
- Microsoft Visio 2013 : Adding Structure to Your Diagrams - Sizing containers
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 3) - The Other Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 2) - The Data Properties of a Control
- Microsoft Access 2010 : Control Properties and Why to Use Them (part 1) - The Format Properties of a Control
- Microsoft Access 2010 : Form Properties and Why Should You Use Them - Working with the Properties Window
- Microsoft Visio 2013 : Using the Organization Chart Wizard with new data
- First look: Apple Watch

- 3 Tips for Maintaining Your Cell Phone Battery (part 1)

- 3 Tips for Maintaining Your Cell Phone Battery (part 2)
programming4us programming4us